package router

import (
	jwt "gitee.com/sansaniot/ssiot-core/httpmvc/jwtauth"
	"github.com/gin-gonic/gin"

	"ssdevice/internal/device/apis"
)

func init() {
	RouterCheckRole = append(RouterCheckRole, registerVariableRouter)
}

func registerVariableRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.Sensor{}
	r := v1.Group("/api/var/sensor").Use(authMiddleware.MiddlewareFuncWithOutValidate())
	{
		r.GET("/find", api.FindList)
		//r.GET("/get", api.FindList)
		r.POST("/add", api.AddSensor)
		r.POST("/modify", api.EditSensor)
		r.POST("/remove", api.DeleteSensor)
		r.GET("/export", api.ExportSensor)
		r.POST("/import", api.ImportSensor)
	}
}
